<html>
  <head>
	<link type="text/css" rel="stylesheet" href="stylesheets/main.css">
    <script type="text/javascript" src="/js/prototype.js"></script>
    <script type="text/javascript" src="/js/newsviewers.js"></script>
    
    
	 <script type="text/javascript">
	   function displayArticle(idArticle){
	     divs=document.getElementsByTagName("div");
	     art_id="art_"+idArticle;
	     for( i=0; i< divs.length; i++){
			if(divs[i]['id'].match("art_.*")){
				if(divs[i]['id'] != art_id){
				  divs[i].style.display='none';
				} else {
				  if(divs[i].style.display=='none'){
				    divs[i].style.display='block';
				  } else {
				    divs[i].style.display='none';
				  }
				}
			}
	     }
	   }
	 </script>
  </head>
	
  <body onload="displayArticle('');">
    <table id="main">
      <tr id="menu"><td colspan="2">
		{{menu}}
      </td></tr>
      <tr id="content">
      	<td class="leftColumn">
      		<ul>
      			<li><a href="home">Tout</a></li>
		    	{% for rss in rss_list %}
		    		<li><a href="home?rssId={{rss.key}}">{{rss.title}}</a></li>
		    	{% endfor %}
		    </ul>
		</td>      
      	<td>
      	{{navigator}}
		<table class="articles">
		  {% for article in rss_article_users %}
		    <tr>
		    <td class="article">
		    <div id="articleTitle_{{article.key}}" class="articleTitle">
		    	<span id="{{article.rss_article.key}}" onclick="displayArticle(id)">
			    	<img src="{{article.rss_article.mainImage}}" width="20px" height="20px">
				    <b>{{article.rss_article.title}}</b> ({{article.rss_article.date}}) 
				    {% if article.rss_article.rss %}
				    , du flux <i>{{article.rss_article.rss.title}}</i>
				    {% endif %}
				    [<a href="{{article.rss_article.link}}">lien</a>]
			    </span> - 
		    	<span id="{{article.key}}" onclick="markAsRead(id);">
		    		<span id="read_{{article.key}}">
				    	{% if article.read %}mark as unread{% else %}mark as read{% endif %}
				    </span>
		    	</span>			    
		    </div>
		    <div id="art_{{article.rss_article.key}}" class="articleContent">
		      <p>{{article.rss_article.content}}</p>
		    </div>
		    </td>
		    <td class="rightColumn"> </td>
		    </tr>
		  {% endfor %}
		</table>
      </td></tr>
    </table>
  </body>
</html>

